<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8" language="java"
	import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/page/base.jsp"%>
<%@ taglib prefix="d" uri="/doone-comm-ui-tags"%>
<html>
	<head>
		<title>评论 管理</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<link type="text/css" href="<%=path%>/manage/css/layout.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="<%=path%>/manage/css/Tooltip.css" />
        <link type="text/css" href="<%=path%>/manage/css/new_style.css" rel="stylesheet" />

		<script type="text/javascript"
			src="<%=path%>/manage/js/jquery-1.4.4.min.js"></script>

		<script type="text/javascript"
			src="<%=path%>/manage/js/easyTooltip.js"></script>
		<script type="text/javascript"
			src="<%=path%>/manage/js/jquery-ui-1.8.11.custom.min.js"></script>
		<script type="text/javascript"
			src="<%=path%>/manage/js/jquery.wysiwyg.js"></script>
		<script type="text/javascript"
			src="<%=path%>/manage/js/hoverIntent.js"></script>
		<script type="text/javascript" src="<%=path%>/manage/js/superfish.js"></script>
		<script type="text/javascript" src="<%=path%>/manage/js/custom.js"></script>
		<script type="text/javascript"
			src="<%=path%>/manage/js/My97DatePicker/WdatePicker.js"></script>
	</head>

	<script type="text/javascript">
	//評論信息删除
	function delComment(resId,tarId,target) {
		if (confirm("慎重考虑是否确定删除该记录?删除后无法查看该条记录！！！")) {
			$.ajax({
				url : root + '/circle/deleteByResId.action',
				method : 'post',
				data : {
					'resId' : resId
				},
				success : function(data) {
				var typeFlag=$("#typeFlag").val();
				if(typeFlag==0){
					window.location.href=root+"/circle/getCircleManageInit.action?tarId="+tarId;
				}else{
				//alert("/circle/getCircleInitByResId.action?resId="+target+"&tarId="+tarId);
					window.location.href=root+"/circle/getCircleInitByResId.action?resId="+target+"&tarId="+tarId;
				}
				},
				error : function(err) {
					if (err.responseText != '')
						alert(err.responseText);
					else
						alert("请求失败！");
				}
			});
		}
	}
</script>
	<body>
		<div>
			<p class="sitemap">
				当前位置：内容管理 > 圈子管理
			</p>
			<h1>
				圈子管理
			</h1>
			<div>
				<!-- Tabs -->
				<div id="tabs">
					<ul>
						<li>
						<s:if test="typeFlag==0">
							<a href="#tabs-1">主题列表</a>
						</s:if>
						<s:else>
							<a href="#tabs-1">回复列表</a>
						</s:else>
						</li>

					</ul>
					<!-- 检索 

					<form name="searchForm" id="searchForm" method="post"
						action="<%=path%>/comment/getCommentInfo.action" style="margin:10px 0;">
						内容标题:
						<s:textfield name="condition.varContentName"></s:textfield>
						评论内容:
						<s:textfield name="condition.varCommentContent"></s:textfield>						
						<input type="button" id="searchBtn" value="检索">
						<script type="text/javascript">
							function resetSearchCondition(){
								$("#condition_varContentName").val("");
								$("#condition_varCommentContent").val("");
							}
						</script>
						<input type="button" id="setBtn" value="重置" onclick="resetSearchCondition()">
					</form>-->
					<s:hidden name="tarId"></s:hidden>
					<s:hidden name="typeFlag" id="typeFlag"></s:hidden>
					<table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
						<thead>
							<tr> <s:if test="typeFlag==0">
								<td>
									用户名称
								</td>
								
								<td>
									主题内容
								</td>
								<td>
									发布时间
								</td>
								<td>
									图片管理
								</td>
								<td>
									回复条数
								</td>
								<td>操作</td>
								</s:if>
								<s:else>
								<td>
									回复人
								</td>
								
								<td>
									回复内容
								</td>
								<td>
									回复时间
								</td>
								<td>操作</td>
								</s:else>
							</tr>
						</thead>
						<tbody>
							<s:iterator value="reslist">
						
								<tr class="odd">
								    
									<td>
										<s:property value="userName" />
									</td>
									 <td><s:if test="content.length()>20">
										<s:property value="content.substring(0,20)" />......
									</s:if>
									<s:else>
										<s:property value="content" />
									</s:else>	</td>
									 <td><s:property value="createDt"/></td>
									  <s:if test="typeFlag==0">
									   <td><a  href="<%=path %>/circle/getCirclePhotoInfo.action?tarId=<s:property value="tarId"/>&resId=<s:property value="id"/>">图片管理</a></td>
									 <td><a  href="<%=path %>/circle/getCircleInitByResId.action?resId=<s:property value="id"/>&tarId=<s:property value="tarId"/>"><s:property value="commentCount"/></a>  </td>
									 </s:if>
									 <td>
										<a class="icon icon_delete" title="删除" href=" javascript:delComment(<s:property value="id"/>,<s:property value="tarId"/>,<s:property value="parentId"/>)"></a>
									</td>

								</tr>
								
							</s:iterator>
						</tbody>
					</table>
				</div>
				<s:if test="typeFlag==1">
				<a href="<%=path %>/circle/getCircleManageInit.action?tarId=<s:property value="tarId"/>" class="button">返回</a>
				<div align="right" style="float: right;">
					<d:page id="pageComment" template="details" skin="gray">
					</d:page>
				</div>
				</s:if><s:else>
				<div align="right" style="float: right;">
					<d:page id="pageSummary" template="details" skin="gray">
					</d:page>
				</div>
				</s:else>
			</div>
		</div>
	</body>
</html>
